$(window).load(function(){}); problem in Opera
Posted
by Slammer
on Stack Overflow
See other posts from Stack Overflow
or by Slammer
Published on 2010-04-25T08:44:51Z
Indexed on
2010/04/25
8:53 UTC
Read the original article
Hit count: 174
Hello. I need to recalculate body's main div height, than wait while all content (images) loads and only than show it to site visitor.
To achieve this i used jQuery and CSS
//CSS looks like
body {display: none;}
/* div block height calculator */
function recalculateHeight(id, add){
var height = $(id).height();
if (height < 650) height = 650;
if (add)
height = height + add;
$('#left_div').height(height);
$('#center_div').height(height);
$('#right_div').height(height);
}
//recalculate height when page is fully loaded
$(document).ready(function(){
$(window).load(function(){
$('body').show();
recalculateHeight("#center_div");
});
});
Everything works fine in IE, Firefox, Safari.
In Chrome height calculation works, but seems that body doesn't hides, because all images loads as usual they should.
In Opera, both functions doesn't work. Not page is showed when all content is loaded, not page calculation works.
You would better understand what I am talking about:
Site where this problem is
Thanks for Your response, brgds
© Stack Overflow or respective owner